package cr.co.tse.padronelectoral.csv;

import java.io.IOException;

import au.com.bytecode.opencsv.CSVReader;

/**
 * http://opencsv.sourceforge.net/ implementation wrapper.
 * 
 * @author jsanca
 * 
 */
public class OpenCsvRowReaderGenericDAOImpl implements RowReaderGenericDAO {

	private CSVReader csvReader = null;

	/**
	 * Constructor.
	 */
	public OpenCsvRowReaderGenericDAOImpl(CSVReader csvReader) {

		this.csvReader = csvReader;
	} // OpenCsvReaderGenericDAOImpl.

	/*
	 * (non-Javadoc)
	 * 
	 * @see cr.smartframework.geo.locator.dao.CsvReaderGenericDAO#next()
	 */
	@Override
	public String[] next() throws IOException {

		return this.csvReader.readNext();
	} // next.

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.io.Closeable#close()
	 */
	@Override
	public void close() throws IOException {

		if (null != this.csvReader) {

			this.csvReader.close();
		}
	} // close.

} // E:O:F:OpenCsvReaderGenericDAOImpl.

